@extends('member.member')

@section('title', '我的社区')

@section('rightcontainer')
<div class="my_question member-container">
	<div class='ent_zhph ent3'>
		<ul class="mem_cate">
			<li class='firt-li'>排序方法:</li>
			<li>
    			<a href='/member/answer?sort=0' class="@if($sort == 0) ent-bgcolor @endif">时间</a>
  			</li>
			<li>|</li>
			<li>
    			<a href='/member/answer?sort=1' class="@if($sort == 1) ent-bgcolor @endif">回复数</a>
  			</li>
		</ul>
		<div class="clearfix"></div>
	</div>			 
    @foreach($answer as $key=>$anw)
	<div class="mem_cont mt-10 @if($key>0) bodertop @endif" id="news_{{ $anw->id }}">
		<div class="l-h-30 mt-10 ml-10" style="height: auto;">
            <span class="fl word" style="display:inline-block;width:80%;">
                @if(count($anw->question)>0)
                <a href="{{url('/bbs/'.$anw->question->id)}}" class="ft-18 ft-w " >
                @else 
                <a href="#"> @endif
                {!!$anw->title!!}
                </a>
            </span>
            <span class="fl ml-20 ft-14 cor-5">by {{ count($anw->user)>0?$anw->user->name:'用户不存在'}}</span>
			<span class="fr">
				<a href="javascript:void(0)" onclick="delete_one('/member/answer/{{$anw->id}}','{{$anw->id}}','{{csrf_token()}}')">
				    <img src="{{ asset('/images/front/member/trash.png')}}">
				</a>
			</span>
			<div class="clearfix"></div>
		</div>
		<div class="l-h-30 ft-14 ml-10 mt-10">
		  @if(count($anw->question)>0)<a href="{{url('/bbs/'.$anw->question->id)}}">{{$anw->question->title}}</a>@else <a href="#">原帖子不存在或已删除</a> @endif
		</div>
		<div class="l-h-30 ft-16 ml-10">
			<span class="fl">{{$anw->comment_count}}</span>
			<span class="fl cor-4">个回答</span>
			<div class="clearfix"></div>
		</div>
	</div>
	@endforeach
</div>
@stop

@section('footer')
    @parent
@stop

